package com.example.dbsample.exception;

import lombok.Getter;

@Getter
public class BusinessException extends RuntimeException{
    private String code = "-1";

    private String message;

    public BusinessException(String message) {
        super(message);
        this.message = message;
    }

    public BusinessException(String message, Throwable cause) {
        super(message, cause);
        this.message = message;
    }

    public BusinessException(String message, String code) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public BusinessException(String message, Throwable cause, String code) {
        super(message, cause);
        this.code = code;
        this.message = message;
    }

    private String generatorMessage() {
        return message;
    }

    @Override
    public String getMessage() {
        return generatorMessage();
    }
}
